using Godot.Collections;
public enum ToolType
{
    Hand, PickAxe, Axe, Hammer, Shovel, Wrench
}
public class Tool
{
    public ToolType type;
    public int level = 0;
    public int punish = 1;
    public bool drop = true;
    public Tool() { }
    public Tool(ToolType type, int l, int punish = 1, bool drop = true)
    {
        this.type = type;
        this.level = l;
        this.punish = punish;
        this.drop = drop;
    }
    public bool CanBreak(Tool toolTypeItem)
    {
        if (toolTypeItem.type == type && toolTypeItem.level >= level)
        {
            return true;
        }
        return false;
    }
    public Dictionary GetDictionary()
    {
        Dictionary dict = new Dictionary();
        dict.Add("type", type);
        dict.Add("level", level);
        dict.Add("punish", punish);
        dict.Add("drop", drop);
        return dict;
    }
    public Tool Parse(Dictionary dict)
    {
        this.type = (ToolType)dict["type"].ToInt();
        this.level = dict["level"].ToInt();
        this.punish = dict["punish"].ToInt();
        this.drop = (bool)dict["drop"];
        return this;
    }
}